import {Base} from '../../utils/base.js';

class Home extends Base{
  
  constructor() {
      super();
  }

  getBannerData(id,callBack){
    // wx.request({
    //   url: 'http://z.api.cn/api/v1/banner/' + id,
    //   method:'GET',
    //   success:function(res){
    //     callBack(res);
    //   }
    // })
    var params = {
      url:'banner/' + id,
      sCallBack: function (data){
        // data = data.items;
        callBack && callBack(data.items);
      }
    }
    this.request(params);
  }

  getThemeData(ids, callBack){
    var params = {
      url: 'theme?ids='+ ids,
      sCallBack: function (data) {
        data = data.data;
        callBack && callBack(data);
      }
    }
    this.request(params);
  }

  getProductorData(callBack){
    var params = {
      url: 'product/recent/?count=8',
      sCallBack: function (data) {
        data = data.data;
        callBack && callBack(data);
      }
    }
    this.request(params);
  }

}

export {Home};